define('CONNECTION_ATTEMPTS_CLEANUP_TIME', 10); // connectionAttempts.txt entries cleanup time (in days)
define('LOGIN_TOKEN_LIFETIME', 60); // Login token lifetime, in seconds
define('LOGIN_TOKEN_CHECK_IP', false); // Set to true to check client connects with same IP that the IP used for connection to central authentication server (disabled)
$nbWrongPasswordTyped=0; // Global var, number of wrong password typed by an IP adress in passwordCheckBanPeriod time interval
$userToDisplaySeqNumber=0; // Sequential user number on login page
/**
* @desc function called on successful user login: load parameters and display left panel and 1st resource
* if $userConfigFileName is provided, load user from filename
* @param string $userId: user id
* @param string $userConfigFileName (optional): user configuration file
* @return void
*/
function userLoad($userId,$userConfigFileName=false){
if(!$userId && !$userConfigFileName) die('User ID not found');
// Temp store session data as $_SESSION will be erased by wSession_start, and some usefull data may already have been stored into (cfGSetVar)
if(@$_SESSION) $tmp=$_SESSION;
// Destroy previous session if existing (might have been started by /index.php)